<?php  function read_file($l1){ return @file_get_contents($l1); } function write_file($l1, $l2=''){ $dir = dirname($l1); if(!is_dir($dir)){ mkdirss($dir); } return @file_put_contents($l1, $l2); } function mkdirss($dirs,$mode=0777) { if(!is_dir($dirs)){ mkdirss(dirname($dirs), $mode); return @mkdir($dirs, $mode); } return true; } function arr2file($filename, $arr=''){ if(is_array($arr)){ $con = var_export($arr,true); } else{ $con = $arr; } $con = "<?php\nreturn $con;\n?>"; write_file($filename, $con); } function get_http_url(){ return htmlspecialchars("http://".$_SERVER['HTTP_HOST'].$_SERVER["REQUEST_URI"]); } function get_site_path($filename){ $basepath = $_SERVER['PHP_SELF']; $basepath = substr($basepath,0,strpos($basepath,$filename)); return $basepath; } function get_base_url($baseurl,$url){ if("#" == $url){ return ""; }elseif(FALSE !== stristr($url,"http://")){ return $url; }elseif( "/" == substr($url,0,1) ){ $tmp = parse_url($baseurl); return $tmp["scheme"]."://".$tmp["host"].$url; }else{ $tmp = pathinfo($baseurl); return $tmp["dirname"]."/".$url; } } function get_domain($url){ preg_match("|http://(.*)\/|isU", $url, $arr_domain); return $arr_domain[1]; } function u2g($str){ return iconv("UTF-8","GBK",$str); } function g2u($str){ return iconv("GBK","UTF-8//ignore",$str); } function nr($str){ $str = str_replace(array("<nr/>","<rr/>"),array("\n","\r"),$str); return trim($str); } function nb($str){ $str = str_replace("　",' ',str_replace("&nbsp;",' ',$str)); $str = ereg_replace("[\r\n\t ]{1,}",' ',$str); return trim($str); } function t2js($l1, $l2=1){ $I1 = str_replace(array("\r", "\n"), array('', '\n'), addslashes($l1)); return $l2 ? "document.write(\"$I1\");" : $I1; } function ff_mb_strlen($string = null) { preg_match_all("/./us", $string, $match); return count($match[0]); } function msubstr($str, $start=0, $length, $suffix=false){ return ff_msubstr(eregi_replace('<[^>]+>','',ereg_replace("[\r\n\t ]{1,}",' ',nb($str))),$start,$length,'utf-8',$suffix); } function ff_msubstr($str, $start=0, $length, $charset="utf-8", $suffix=true){ $re['utf-8'] = "/[\x01-\x7f]|[\xc2-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xff][\x80-\xbf]{3}/"; $re['gb2312'] = "/[\x01-\x7f]|[\xb0-\xf7][\xa0-\xfe]/"; $re['gbk'] = "/[\x01-\x7f]|[\x81-\xfe][\x40-\xfe]/"; $re['big5'] = "/[\x01-\x7f]|[\x81-\xfe]([\x40-\x7e]|\xa1-\xfe])/"; preg_match_all($re[$charset], $str, $match); $length_new = $length; for($i=$start; $i<$length; $i++){ if (ord($match[0][$i]) > 0xa0){ }else{ $length_new++; $length_chi++; } } if($length_chi<$length){ $length_new = $length+($length_chi/2); } $slice = join("",array_slice($match[0], $start, $length_new)); if($suffix && $slice != $str){ return $slice."…"; } return $slice; } function ff_pinyin($str,$ishead=0,$isclose=1){ $str = u2g($str); global $pinyins; $restr = ''; $str = trim($str); $slen = strlen($str); if($slen<2){ return $str; } if(count($pinyins)==0){ $fp = fopen('./Public/data/pinyin.dat','r'); while(!feof($fp)){ $line = trim(fgets($fp)); $pinyins[$line[0].$line[1]] = substr($line,3,strlen($line)-3); } fclose($fp); } for($i=0;$i<$slen;$i++){ if(ord($str[$i])>0x80){ $c = $str[$i].$str[$i+1]; $i++; if(isset($pinyins[$c])){ if($ishead==0){ $restr .= $pinyins[$c]; } else{ $restr .= $pinyins[$c][0]; } }else{ } }else if( eregi("[a-z0-9]",$str[$i]) ){ $restr .= $str[$i]; } else{ } } if($isclose==0){ unset($pinyins); } return $restr; } function ff_url_letter($s0){ $firstchar_ord=ord(strtoupper($s0{0})); if (($firstchar_ord>=65 and $firstchar_ord<=91)or($firstchar_ord>=48 and $firstchar_ord<=57)) return $s0{0}; $s=iconv("UTF-8","gb2312", $s0); $asc=ord($s{0})*256+ord($s{1})-65536; if($asc>=-20319 and $asc<=-20284)return "A"; if($asc>=-20283 and $asc<=-19776)return "B"; if($asc>=-19775 and $asc<=-19219)return "C"; if($asc>=-19218 and $asc<=-18711)return "D"; if($asc>=-18710 and $asc<=-18527)return "E"; if($asc>=-18526 and $asc<=-18240)return "F"; if($asc>=-18239 and $asc<=-17923)return "G"; if($asc>=-17922 and $asc<=-17418)return "H"; if($asc>=-17417 and $asc<=-16475)return "J"; if($asc>=-16474 and $asc<=-16213)return "K"; if($asc>=-16212 and $asc<=-15641)return "L"; if($asc>=-15640 and $asc<=-15166)return "M"; if($asc>=-15165 and $asc<=-14923)return "N"; if($asc>=-14922 and $asc<=-14915)return "O"; if($asc>=-14914 and $asc<=-14631)return "P"; if($asc>=-14630 and $asc<=-14150)return "Q"; if($asc>=-14149 and $asc<=-14091)return "R"; if($asc>=-14090 and $asc<=-13319)return "S"; if($asc>=-13318 and $asc<=-12839)return "T"; if($asc>=-12838 and $asc<=-12557)return "W"; if($asc>=-12556 and $asc<=-11848)return "X"; if($asc>=-11847 and $asc<=-11056)return "Y"; if($asc>=-11055 and $asc<=-10247)return "Z"; return 0;} function ff_encrypt($data, $key){ $key = md5(empty($key) ? 'feifeicms' : $key); $x = 0; $len = strlen($data); $l = strlen($key); for ($i = 0; $i < $len; $i++) { if ($x == $l) { $x = 0; } $char .= $key{$x}; $x++; } for ($i = 0; $i < $len; $i++) { $str .= chr(ord($data{$i}) + (ord($char{$i})) % 256); } return base64_encode($str); } function ff_decrypt($data, $key){ $key = md5(empty($key) ? 'feifeicms' : $key); $x = 0; $data = base64_decode($data); $len = strlen($data); $l = strlen($key); for ($i = 0; $i < $len; $i++) { if ($x == $l) { $x = 0; } $char .= substr($key, $x, 1); $x++; } for ($i = 0; $i < $len; $i++) { if (ord(substr($data, $i, 1)) < ord(substr($char, $i, 1))) { $str .= chr((ord(substr($data, $i, 1)) + 256) - ord(substr($char, $i, 1))); } else { $str .= chr(ord(substr($data, $i, 1)) - ord(substr($char, $i, 1))); } } return $str; } function ff_user_cookie(){ $encrypt = cookie('ff_user'); if($encrypt){ $user_cookie = explode('$feifeicms$', ff_decrypt($encrypt)); $array = array(); $array['user_id'] = intval($user_cookie[0]); $array['user_name'] = htmlspecialchars($user_cookie[1]); return $array; }else{ return false; } } function ff_array($array, $key=0){ return $array[$key]; } function ff_arrays2array($array){ static $result_array=array(); foreach($array as $value){ if(is_array($value)){ ff_arrays2array($value); }else{ $result_array[]=$value; } } return $result_array; } function ff_unique($cids){ $cidarr = explode(',',$cid); $cidarr = array_unique($cidarr); return $cidarr; } function ff_default($value, $default){ if($value){ return $value; } return $default; } function ff_sid2module($sid){ $module = array(); $module[1] = 'vod'; $module[2] = 'news'; $module[3] = 'special'; $module[4] = 'tag'; $module[5] = 'guestbook'; $module[6] = 'forum'; $module[7] = 'scenario'; $module[8] = 'star'; $module[9] = 'role'; $module[10] = 'pic'; $module[11] = 'link'; $module[12] = 'ads'; $module[13] = 'list'; $module[14] = 'nav'; $module[15] = 'player'; $module[16] = 'slide '; $module[17] = 'user'; $module[18] = 'record'; $module[19] = 'score'; $module[20] = 'orders'; $module[21] = 'cj'; $module[22] = 'pay'; $module[23] = 'card'; $module[23] = 'email'; return $module[$sid]; } function ff_module2sid($sidname){ $module = array(); $module['vod'] = 1; $module['news'] = 2; $module['special'] = 3; $module['tag'] = 4; $module['guestbook'] = 5; $module['forum'] = 6; $module['scenario'] = 7; $module['star'] = 8; $module['role'] = 9; $module['pic'] = 10; $module['link'] = 11; $module['ads'] = 12; $module['list'] = 13; $module['nav'] = 14; $module['player'] = 15; $module['slide'] = 16; $module['user'] = 17; $module['rcord'] = 18; $module['score'] = 19; $module['ordes'] = 20; $module['cj'] = 21; $module['pay'] = 22; $module['card'] = 23; $module['email'] = 24; return intval($module[$sidname]); } function ff_file_get_contents($url, $timeout=10, $referer='', $post_data=''){ if(function_exists('curl_init')){ $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_HEADER, 0); curl_setopt ($ch, CURLOPT_TIMEOUT, $timeout); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt ($ch, CURLOPT_REFERER, $referer); curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1); if($post_data){ curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); } $http = parse_url($url); if($http['scheme'] == 'https'){ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); } $content = curl_exec($ch); curl_close($ch); if($content){ return $content; } } $ctx = stream_context_create(array('http'=>array('timeout'=>$timeout))); $content = @file_get_contents($url, 0, $ctx); if($content){ return $content; } return false; } function ff_preg_match($rule,$html){ $arr = explode('$$$',$rule); if(count($arr) == 2){ preg_match('/'.$arr[1].'/', $html, $data); return $data[$arr[0]].''; }else{ preg_match('/'.$rule.'/', $html, $data); return $data[1].''; } } function ff_preg_match_all($rule,$html){ $arr = explode('$$$',$rule); if(count($arr) == 2){ preg_match_all('/'.$arr[1].'/', $html, $data); return $data[$arr[0]]; }else{ preg_match_all('/'.$rule.'/', $html, $data); return $data[1]; } } function ff_krsort_url($listurl){ krsort($listurl); foreach($listurl as $val){ $list[]=$val; } return $list; } function ff_implode_rule($arr){ foreach($arr as $val){ $array[] = trim(stripslashes($val)); } return implode('|||',$array); } function ff_replace_rule($str){ $arr1 = array('?','"','(',')','[',']','.','/',':','*','||'); $arr2 = array('\?','\"','\(','\)','\[','\]','\.','\/','\:','.*?','(.*?)'); return str_replace('\[$feifeicms\]','([\s\S]*?)',str_replace($arr1,$arr2,$str)); } function ff_rand_str($string){ $arr = C('collect_original_data'); $all=iconv_strlen($string,'utf-8'); $len=floor(mt_rand(0,$all-1)); $str = msubstr($string,0,$len); $str2 = msubstr($string,$len,$all); return $str.$arr[array_rand($arr,1)].$str2; } function ff_bind_id($key){ $bindcache = F('_cj/bind'); return $bindcache[$key]; } function ff_tag_auto($title,$content){ $data = ff_file_get_contents('http://cdn.feifeicms.co/server/v3/kw.php?source='.rawurlencode(msubstr($title.$content,0,200))); if($data) { return implode(',',json_decode($data,true)); } return false; } function ff_xml_vodname($vodname){ $vodname = str_replace(array('【','】','（','）','(',')','{','}'),array('[',']','[',']','[',']','[',']'),$vodname); $vodname = preg_replace('/\[([a-z][A-Z])\]|([a-z][A-Z])版/i','',$vodname); $vodname = preg_replace('/TS清晰版|枪版|抢先版|HD|BD|TV|DVD|VCD|TS|\/版|\[\]/i','',$vodname); return trim($vodname); } function ff_xml_vodactor($vodactor){ return str_replace(array('/','，','|','、',' ',',,,'),',',$vodactor); } function ff_linux_time($day){ $day = intval($day); return mktime(23,59,59,date("m"),date("d")-$day,date("y")); } function ff_color($str, $color){ if(empty($color)){ return $str; }else{ return '<font color="'.$color.'">'.$str.'</font>'; } } function ff_gold($fen){ $array = explode('.',$fen); return '<strong>'.$array[0].'</strong>.'.$array[1]; } function ff_content_img($content, $sid='news'){ preg_match_all('#<img.*?src=[\'|\"]([^"]*)[\'|\"][^>]*>#i', $content, $match); foreach($match[1] as $imgurl){ $imgsave = D('Img')->down_load(trim($imgurl), 'news'); if($imgsave != $imgurl){ $content = str_replace($imgurl, C('site_path').C('upload_path').'/'.$imgsave, $content); } } return $content; } function ff_color_date($type='Y-m-d H:i:s',$time,$color='red'){ if((time()-$time)>86400){ return date($type,$time); }else{ return '<font color="'.$color.'">'.date($type,$time).'</font>'; } } function ff_page_count($pageid='pageid', $key='records'){ $page = $_GET['ff_page_'.$pageid]; if(!$page){ return false; } return $page[$key]; } function ff_page_max($currentpage, $totalpages){ if ($currentpage > $totalpages){ $currentpage = $totalpages; } return $currentpage; } function ff_site_hot($type='home'){ if(!C('site_hot')){ return false; } $array_hot = array(); foreach(explode(chr(13),trim(C('site_hot'))) as $key=>$value){ $array = explode('|',$value); if($array[2]){ $target = ' target="'.$array[2].'"'; }else{ $target = ''; } if($array[1]){ $array_hot[$key] = '<a href="'.$array[1].'"'.$target.'>'.trim($array[0]).'</a>'; }else{ $array_hot[$key] = '<a href="'.ff_url('vod/search',array('wd'=>urlencode(trim($array[0]))),true).'"'.$target.'>'.trim($array[0]).'</a>'; } } if(C('url_html') && $type=='home'){ return '<span class="ff-site-hot" id="ff-site-hot">'.implode('',$array_hot).'</span>'; } return implode('',$array_hot); } function ff_get_hits($sidname, $type='hits', $array, $js=true){ if((C('url_html') && $js) || $type=='insert'){ return '<span class="ff-hits" data-sid="'.$sidname.'" data-id="'.$array[$sidname.'_id'].'" data-type="'.$type.'"></span>'; }else{ return $array[$type]; } } function ff_detail_array($module='vod', $type='next', $id, $cid, $field='vod_id,vod_cid,vod_status,vod_name,vod_ename,vod_jumpurl'){ $where = array(); $where[$module.'_cid'] = $cid; $where[$module.'_status'] = 1; if($type == 'next'){ $where[$module.'_id'] = array('gt', $id); $order = $module.'_id asc'; }else{ $where[$module.'_id'] = array('lt', $id); $order = $module.'_id desc'; } if($module != 'vod'){ $field = str_replace('vod_', $module.'_', $field); } $array = D(ucfirst($module))->ff_find($field, $where, 'cache_page_'.$module.$type.'_'.$id, false, $order); return $array; } function ff_player($array){ if(C('play_cloud')){ return '<script type="text/javascript" src="'.C('play_cloud').'?u='.base64_encode($array['play_url']).'&p='.$array['play_name_en'].'&c='.$array['play_copygiht'].'&j='.base64_encode($array['play_jiexi']).'&x='.$array['play_second'].'&y='.base64_encode($array['play_buffer']).'&z='.base64_encode($array['play_url_next']).'"></script>'."\n"; } $json = array(); $json['url'] = $array['play_url']; $json['copyright'] = $array['play_copygiht']; $json['name'] = $array['play_name_en']; if($array['play_copygiht']){ $json['name'] = 'copyright'; } $json['jiexi'] = $array['play_jiexi']; $json['time'] = $array['play_second']; $json['buffer'] = $array['play_buffer']; $json['next_url'] = $array['play_url_next']; return '<script>var cms_player = '.json_encode($json).';</script><script type="text/javascript" src="'.C('site_path').'Public/player/'.$json['name'].'.js" ></script>'; } function ff_play_list($server, $play, $url){ $conf_play = F('_feifeicms/player'); $conf_server = C('play_server'); $array_server = explode('$$$',$server); $array_play = explode('$$$',$play); $array_url = explode('$$$',$url); $array = array(); foreach($array_play as $sid=>$val){ $array[$val][$sid] = $array_url[$sid]; } $play_list = array(); foreach($conf_play as $conf_key=>$conf_value){ if($play_one = $array[$conf_key]){ foreach($play_one as $sid=>$url_one){ $son = ff_play_list_one($url_one, $conf_server[$array_server[$sid]]); $play_list[$sid+1] = array( 'server_name' => $array_server[$sid], 'server_url' => $conf_server[$array_server[$sid]], 'player_sid' => $sid+1, 'player_name_en' => $conf_key, 'player_name_zh' => $conf_value[0], 'player_copyright' => $conf_value[2], 'player_info' => $conf_value[1], 'player_jiexi' => $conf_value[3], 'player_count' => count($son), 'son' => $son, ); } } } return $play_list; } function ff_play_list_one($url_one, $server_url){ $url_list = array(); $array_url = explode(chr(13),str_replace(array("\r\n", "\n", "\r"),chr(13),$url_one)); foreach($array_url as $key=>$val){ list($title, $url, $logo, $title_rc, $player) = explode('$', $val); if ( empty($url) ) { $url_list[$key]['title'] = '第'.($key+1).'集'; $url_list[$key]['url'] = $server_url.$title; }else{ $url_list[$key]['title'] = $title; $url_list[$key]['url'] = $server_url.$url; } $url_list[$key]['url'] = str_replace('{feifeicms}','',$url_list[$key]['url']); $url_list[$key]['logo'] = str_replace('{feifeicms}','',$logo); $url_list[$key]['title_rc'] = str_replace('{feifeicms}','',$title_rc); $url_list[$key]['player'] = str_replace('{feifeicms}','',$player); } return $url_list; } function ff_play_one($vod_play_list, $play_name='max'){ if($play_name == 'max'){ $max = $vod_play_list[0]['player_count']; $max_key = 0; foreach($vod_play_list as $key=>$value){ if( $value['player_count'] > $max && (!in_array($value['player_name_en'], array('yugao','down'))) ){ $max = $value['player_count']; $max_key = $key; } } return $vod_play_list[$max_key]; }else{ $play = list_search($vod_play_list, array('player_name_en'=>$play_name)); return $play[0]; } } function ff_PaymentItem(){ $array = array(); if(C('pay_code_appid')){ $code_pay_type = explode(',',C('pay_code_type')); if(in_array(1,$code_pay_type)){ array_push($array, 'code_ali'); } if(in_array(3,$code_pay_type)){ array_push($array, 'code_wxpay'); } if(in_array(2,$code_pay_type)){ array_push($array, 'code_qq'); } } if(C('pay_rj_appid')){ array_push($array, 'rj'); } if(C('pay_paypal_account')){ array_push($array, 'paypal'); } if(C('pay_alipay_account')){ array_push($array, 'alipay'); } if(C('pay_wxpay_account')){ array_push($array, 'wxpay'); } return $array; } function ff_Mintue2Length($minute){ return intval($minute*60); } function ff_Length2Second($length){ list($hour,$minute,$second) = explode(':',$length); return intval($hour*3600)+intval($minute*60)+intval($second); } function ff_Second2Length($second){ if($second){ $array = array(); $array['houer'] = floor($second/3600); $array['minute'] = floor(($second-3600 * $array['houer'])/60); $array['second'] = floor((($second-3600 * $array['houer']) - 60 * $array['minute']) % 60); return sprintf("%02d",$array['houer']).':'.sprintf("%02d",$array['minute']).':'.sprintf("%02d",$array['second']); }else{ return '00:00:00'; } } function ff_ThunderEncode($url) { $thunderPrefix = "AA"; $thunderPosix = "ZZ"; $thunderTitle = "thunder://"; if(strstr($url,"thunder://")){ return $url; }elseif(strstr($url,"magnet")){ return $url; }else{ $thunderUrl = $thunderTitle.base64_encode($thunderPrefix.$url.$thunderPosix); } return $thunderUrl; } function ff_url_replace_route($model, $params, $url){ $array_key = explode('/',$model); foreach($params as $key=>$value){ array_push($array_key, $key); } $key = implode('/',$array_key); $url_rules = C('url_rewrite_rules'); if($url_rules[$key]){ $url = preg_replace("/".$url_rules[$key]['find']."/i", $url_rules[$key]['replace'], $url); } return $url; } function ff_url_replace_html($model, $link){ $replace = false; if( $model=='news/show' ){ if(C('url_news_list')){ $replace = true; } }else if( $model=='vod/show' ){ if(C('url_vod_list')){ $replace = true; } }else if( $model=='news/read' ){ if(C('url_news_detail')){ $replace = true; } }else if( $model=='vod/read' ){ if(C('url_vod_detail')){ $replace = true; } } if($replace){ $old = array('/index'.C('html_file_suffix'), '-1'.C('html_file_suffix'), '_1'.C('html_file_suffix')); $new = array('/', C('html_file_suffix'), C('html_file_suffix')); $link = str_replace($old, $new, $link); } return $link; } function ff_url_build($module, $params){ $old = array('{listid}', '{listdir}', '{pinyin}', '{id}', '{md5}', '{page}', '{sid}', '{pid}'); $new = array($params['list_id'], $params['list_dir'], $params['pinyin'], $params['id'], md5($params['id']), $params['p'], $params['sid'], $params['pid']); if('vod/read' == $module){ $html_path = C('url_vod_detail'); }else if('vod/play' == $module){ $html_path = C('url_vod_play'); }else if('vod/show' == $module){ $html_path = C('url_vod_list'); }else if('news/read' == $module){ $html_path = C('url_news_detail'); }else if('news/show' == $module){ $html_path = C('url_news_list'); } $html_path = str_replace($old, $new, $html_path); if($params['p'] == 1){ $html_path .= 'BUILD'; $old = array( '/1BUILD', '-1BUILD', '_1BUILD'); $new = array('/indexBUILD', 'BUILD', 'BUILD'); $html_path = str_replace('BUILD', '', str_replace($old, $new, $html_path)); } $suffix = strrchr($html_path, '/'); if($suffix == '/'){ $html_path .= 'index'; } return C('site_path').$html_path; } function ff_url_show($model='vod/show', $params, $suffix=true){ if ($params['jumpurl']) { return $params['jumpurl']; } if(C('url_html')){ $model = str_replace(array('news_list_page','vod_list_page'),'show', $model); if( $model=='news/show' ){ if(C('url_news_list')){ $url = ff_url_build('news/show', $params).C('html_file_suffix'); return ff_url_replace_html($model, $url); } }else if( $model=='vod/show' ){ if(C('url_vod_list')){ $url = ff_url_build('vod/show', $params).C('html_file_suffix'); return ff_url_replace_html($model, $url); } } } if( $model=='vod/show'){ if(C('url_rewrite_rules.vod/category/id')){ $params['id'] = $params['list_dir']; $model = 'vod/category'; } }elseif( $model=='news/show'){ if(C('url_rewrite_rules.news/category/id')){ $params['id'] = $params['list_dir']; $model = 'news/category'; } } unset($params['list_dir']); if(C('URL_ROUTER_ON')){ if($params['p'] == 'FFLINK'){ $params['p'] = 0.20161212; return str_replace('0.20161212', 'FFLINK', ff_url($model, $params, $suffix)); } } return ff_url($model, $params, $suffix); } function ff_url_detail($model='vod/read', $params, $suffix=true){ if ($params['jumpurl']) { return $params['jumpurl']; } if(C('url_html')){ if( $model=='news/read' ){ if(C('url_html') && C('url_news_detail')){ $url = ff_url_build('news/read', $params).C('html_file_suffix'); return ff_url_replace_html($model, $url); } }else if( $model=='vod/read' ){ if(C('url_html') && C('url_vod_detail')){ $url = ff_url_build('vod/read', $params).C('html_file_suffix'); return ff_url_replace_html($model, $url); } }else if($model=='vod/play'){ if(C('url_html') && C('url_vod_play')){ $url = ff_url_build('vod/play', $params).C('html_file_suffix'); return ff_url_replace_html($model, $url); } } } if( $model=='vod/read' ){ if(C('url_rewrite_rules.vod/ename/id')){ $params['id'] = $params['pinyin']; $model = 'vod/ename'; } }elseif( $model=='vod/play' ){ if(C('url_rewrite_rules.vod/eplay/id/sid/pid')){ $params['id'] = $params['pinyin']; $model = 'vod/eplay'; } }elseif( $model=='news/read' ){ if(C('url_rewrite_rules.news/ename/id')){ $params['id'] = $params['pinyin']; $model = 'news/ename'; } } unset($params['pinyin']); unset($params['jumpurl']); unset($params['list_id']); unset($params['list_dir']); return ff_url($model, $params, $suffix); } function ff_url($model, $params, $suffix=true){ if ($params['jumpurl']) { return $params['jumpurl']; } if($params['p'] == 1){ unset($params['p']); } $url = U($model, $params, false, $suffix); $url = str_replace(array('Admin-','Home-','Plus-'),'',$url); if( C('URL_ROUTER_ON') ){ $url = ff_url_replace_route($model, $params, $url); } if(C('url_rewrite')){ $url = str_replace('index.php?s=/','',$url); } return $url; } function ff_url_page($model, $params, $suffix=false, $pageid='pageid', $halfPer=5, $page = false){ if(!$page){ $page = $_GET['ff_page_'.$pageid]; } if(!$page){ return false; } $jumpurl = ff_url_show($model, $params, $suffix); if($page['currentpage'] < $halfPer){ $halfPer = $halfPer+($halfPer-$page['currentpage']); }else{ if($page['currentpage']+$halfPer>$page['totalpages']){ $halfPer = $halfPer+($halfPer-($page['totalpages']-$page['currentpage'])); } } $link=''; if($page['currentpage'] > $halfPer){ $link = '<li class="page-item"><a class="page-link" href="'.str_replace('FFLINK', 1, $jumpurl).'">1..</a></li>'; } if( $page['currentpage'] > 1){ $link .= '<li class="page-item"><a class="page-link" href="'.str_replace('FFLINK', ($page['currentpage']-1), $jumpurl).'">&laquo;</a></li>'; } for($i=$page['currentpage']-$halfPer,$i>1||$i=1,$j=$page['currentpage']+$halfPer,$j<$page['totalpages']||$j=$page['totalpages'];$i<$j+1;$i++){ if($i == 1){ $params['p'] = 1; $firrt_page = ff_url_show($model, $params, $suffix); if($page['currentpage']==1){ $link .= '<li class="page-item disabled"><a class="page-link" href="'.$firrt_page.'">1</a></li>'; }else{ $link .= '<li class="page-item"><a class="page-link" href="'.$firrt_page.'">1</a></li>'; } }else{ if($i == $page['currentpage']){ $link .= '<li class="page-item disabled"><a class="page-link" href="'.str_replace('FFLINK', $i, $jumpurl).'">'.$i.'</a></li>'; }else{ $link .= '<li class="page-item"><a class="page-link" href="'.str_replace('FFLINK', $i, $jumpurl).'">'.$i.'</a></li>'; } } } if($page['currentpage']+$halfPer < $page['totalpages']){ $link .= '<li class="page-item"><a class="page-link" href="'.str_replace('FFLINK', $page['totalpages'], $jumpurl).'">...'.$page['totalpages'].'</a></li>'; } if($page['currentpage'] < $page['totalpages']){ $link .= '<li class="page-item"><a class="page-link" href="'.str_replace('FFLINK', ($page['currentpage']+1), $jumpurl).'">&raquo;</a></li>'; } unset($params['list_dir']); return $link; } function ff_url_vod_show($list_id,$list_dir,$list_page,$suffix=true){ return ff_url_show('vod/show', array('id'=>$list_id,'list_dir'=>$list_dir,'p'=>$list_page), $suffix); } function ff_url_news_show($list_id,$list_dir,$list_page,$suffix=true){ return ff_url_show('news/show', array('id'=>$list_id,'list_dir'=>$list_dir,'p'=>$list_page), $suffix); } function ff_url_vod_read($list_id,$list_dir,$vod_id,$vod_ename,$vod_jumpurl,$suffix=true){ return ff_url_detail('vod/read',array('list_id'=>$list_id,'list_dir'=>$list_dir,'id'=>$vod_id,'pinyin'=>$vod_ename,'jumpurl'=>$vod_jumpurl), $suffix); } function ff_url_vod_play($list_id,$list_dir,$vod_id,$vod_ename,$play_sid,$play_pid,$suffix=true){ return ff_url_detail('vod/play',array('list_id'=>$list_id,'list_dir'=>$list_dir,'id'=>$vod_id,'pinyin'=>$vod_ename,'sid'=>$play_sid,'pid'=>$play_pid),$suffix); } function ff_url_news_read($list_id,$list_dir,$news_id,$news_ename,$news_jumpurl,$news_page=1,$suffix=true){ return ff_url_detail('news/read',array('list_id'=>$list_id,'list_dir'=>$list_dir,'id'=>$news_id,'pinyin'=>$news_ename,'jumpurl'=>$news_jumpurl,'p'=>$news_page), $suffix); } function ff_url_play_end($vod_url){ $arr_url = array(); $arr_urls = explode('$$$',trim($vod_url)); $array = array(); foreach($arr_urls as $key=>$value){ $arr_url[$key] = explode(chr(13), str_replace(array("\r\n", "\n", "\r"), chr(13), $value) ); $array[$key] = array(count($arr_url[$key]), $key); } $max_key = max($array); $play_url_max = explode('$',end($arr_url[$max_key[1]])); if($play_url_max[1]){ return array($max_key[1]+1, $max_key[0], $play_url_max[0], $play_url_max[1], $play_url_max[2], $play_url_max[3]); }else{ return array($max_key[1]+1, $max_key[0], '第'.$max_key[0].'集', $play_url_max[0], $play_url_max[2], $play_url_max[3]); } } function ff_url_ads($str,$charset="utf-8"){ return '<script type="text/javascript" src="'.C('site_path').C('admin_ads_file').'/'.$str.'.js" charset="'.$charset.'"></script>'; } function ff_url_search($str, $type="actor", $sidname='vod', $action='search'){ if(!$str){ return '佚名'; } $array = array(); $str = str_replace(array('/','|',',','，'),',',$str); $arr = explode(',',$str); foreach($arr as $key=>$val){ $array[$key] = '<a href="'.ff_url($sidname.'/'.$action, array($type=>urlencode($val)), true).'">'.$val.'</a>'; } return implode('',$array); } function ff_url_tags($str, $tag_list='vod_tag'){ list($module,$type) = explode('_',$tag_list); return ff_url($module.'/tags', array('name' => urlencode($str) ), true); } function ff_url_tags_content($content, $array_tag){ if($array_tag){ foreach($array_tag as $key=>$value){ if($value['tag_name']){ $keyword = stripslashes($value['tag_name']); $url = '<a href="'.ff_url_tags($value['tag_name'], $value['tag_list']).'" class="ff-tag-link" >'.$keyword.'</a>'; $regEx = '\'(?!((<.*?)|(<a.*?)))('. $keyword . ')(?!(([^<>]*?)>)|([^>]*?</a>))\'s'; $content = preg_replace($regEx, $url, $content); } } } return $content; } function ff_url_img($file, $content, $number=1){ if(!$file){ return ff_url_img_preg($content, $number); } $array = parse_url($file); if(in_array($array['scheme'],array('http','https','ftp'))){ $img_host = explode(chr(13), str_replace(array("\r\n", "\n", "\r"),chr(13),C('upload_safety'))); if( in_array($array['host'], $img_host) ){ return C('site_path').'index.php?g=home&m=images&a=read&url='.base64_encode($file); } return $file; } $prefix = C('upload_http_prefix'); if(!empty($prefix)){ return $prefix.$file; }else{ return C('site_path').C('upload_path').'/'.$file; } } function ff_url_img_small($file, $content, $number=1){ if(!$file){ return ff_url_img_preg($content, $number); } $array = parse_url($file); if(in_array($array['scheme'],array('http','https','ftp'))){ return $file; } $length = strpos($file, '/'); $file_s = substr($file, 0, $length).'-s'.substr($file, $length); $prefix = C('upload_http_prefix'); if(!empty($prefix)){ return $prefix.$file_s; }else{ return C('site_path').C('upload_path').'/'.$file_s; } } function ff_url_img_preg($content, $number=1, $ext='gif|jpg|jpeg|bmp|png'){ preg_match_all("/(href|src)=([\"|']?)([^ \"'>]+\.($ext))\\2/i", $content, $matches); $imgarr = array_unique($matches[3]); $countimg = count($imgarr); if($number > $countimg){ $number = $countimg; } $imgurl = $imgarr[($number-1)]; if($imgurl){ return $imgurl; } return C('site_path').'Public/images/no.png'; } function ff_url_letters($file='vod',$str=''){ if(C('url_html')){ $index='index.html'; }else{ $index='index.php'; } for($i=1;$i<=26;$i++){ $url = ff_url($file.'/search', array('id'=>chr($i+64),'x'=>'letter'), true); $str.='<a href="'.$url.'" class="letter_on">'.chr($i+64).'</a>'; } return $str; } function ff_list_find($cid, $field='list_name'){ $info = D("List")->ff_find($field, array('list_id'=>array('eq',$cid)), false); if($info){ return $info[$field]; }else{ return false; } } function ff_list_isson($pid){ $count = M("List")->where('list_pid='.$pid)->count('list_id'); if($count){ return false; }else{ return true; } } function ff_list_ids($cid){ $tree = list_search(ff_mysql_list('limit:0;cahce_name:default;cahce_time:default;order:list_oid;sort:asc'), 'list_id='.$cid); $array = array(); if (!empty($tree[0]['list_son'])) { foreach($tree[0]['list_son'] as $val){ $array[] = $val['list_id']; } } array_push($array, $cid); return implode(',', array_unique($array)); } function ff_list_count($cid=999){ $where = array(); if(999 == $cid){ $where['vod_cid'] = array('gt',0); $where['vod_addtime'] = array('gt',ff_linux_time(1)); $count = M("Vod")->where($where)->count('vod_id'); }elseif(0 == $cid){ $where['vod_cid'] = array('gt',0); $count = M("Vod")->where($where)->count('vod_id'); }else{ $sid = ff_list_find($cid,'list_sid'); if ($sid == '2'){ $where['news_cid'] = array('in',ff_list_ids($cid)); $where['news_status'] = 1; $count = M("News")->where($where)->count('news_id'); }else{ $where['vod_cid'] = array('in',ff_list_ids($cid)); $where['vod_status'] = 1; $count = M("Vod")->where($where)->count('vod_id'); } } return $count+0; } function ff_param_url(){ $array = array(); $array['id'] = intval($_REQUEST['id']); $array['type'] = htmlspecialchars(urldecode(trim($_REQUEST['type']))); $array['area'] = htmlspecialchars(urldecode(trim($_REQUEST['area']))); $array['year'] = htmlspecialchars($_REQUEST['year']); $array['star'] = htmlspecialchars(urldecode(trim($_REQUEST['star']))); $array['state'] = htmlspecialchars(urldecode(trim($_REQUEST['state']))); $array['ispay'] = htmlspecialchars(trim($_REQUEST['ispay'])); $array['order'] = ff_order_by($_GET['order']); $array['limit'] = !empty($_GET['limit']) ? intval($_GET['limit']) : 10; $array['page'] = !empty($_GET['p']) ? intval($_GET['p']) : 1; $array['ajax'] = intval($_REQUEST['ajax']); $array['sid'] = intval($_REQUEST['sid']); $array['cid'] = intval($_REQUEST['cid']); $array['wd'] = htmlspecialchars(urldecode(trim($_REQUEST['wd']))); $array['language'] = htmlspecialchars(urldecode(trim($_REQUEST['language']))); $array['letter'] = htmlspecialchars(trim($_REQUEST['letter'])); $array['actor'] = htmlspecialchars(urldecode(trim($_REQUEST['actor']))); $array['director'] = htmlspecialchars(urldecode(trim($_REQUEST['director']))); $array['name'] = htmlspecialchars(urldecode(trim($_REQUEST['name']))); $array['ename'] = htmlspecialchars(trim($_REQUEST['ename'])); $array['remark'] = htmlspecialchars(urldecode(trim($_REQUEST['remark']))); $array['play'] = htmlspecialchars(urldecode(trim($_REQUEST['play']))); $array['inputer'] = htmlspecialchars(urldecode(trim($_REQUEST['inputer']))); $array['tag'] = htmlspecialchars(urldecode(trim($_REQUEST['tag']))); return $array; } function ff_param_jump($where){ if($where['sid']){ $jumpurl['sid'] = $where['sid']; } if($where['id']){ $jumpurl['id'] = $where['id']; } if($where['year']){ $jumpurl['year'] = $where['year']; } if($where['language']){ $jumpurl['language'] = urlencode($where['language']); } if($where['area']){ $jumpurl['area'] = urlencode($where['area']); } if($where['letter']){ $jumpurl['letter'] = $where['letter']; } if($where['actor']){ $jumpurl['actor'] = urlencode($where['actor']); } if($where['director']){ $jumpurl['director'] = urlencode($where['director']); } if($where['wd']){ $jumpurl['wd'] = urlencode($where['wd']); } if($where['order'] != 'addtime' && $where['order']){ $jumpurl['order'] = $where['order']; } if($where['limit']){ $jumpurl['limit'] = $where['limit']; } $jumpurl['p'] = ''; return $jumpurl; } function ff_order_by($order = 'addtime'){ if(empty($order)){ return 'hits'; } $array = array(); $array['id'] = 'id'; $array['hits'] = 'hits'; $array['hits_month'] = 'hits_month'; $array['hits_week'] = 'hits_week'; $array['stars'] = 'stars'; $array['up'] = 'up'; $array['down'] = 'down'; $array['gold'] = 'gold'; $array['golder'] = 'golder'; $array['score'] = 'score'; $array['year'] = 'year'; $array['letter'] = 'letter'; $array['addtime'] = 'addtime'; $array['filmtime'] = 'filmtime'; $array['logtime'] = 'logtime'; $array['deadtime'] = 'deadtime'; return $array[trim($order)]; } function ff_param_lable($tag = ''){ if(is_array($tag)){ return $tag; } $param = array(); $array = explode(';', $tag); foreach ($array as $v){ list($key,$val) = explode(':',trim($v)); $param[trim($key)] = trim($val); } return $param; } function ff_mysql_param($tag){ $params = array(); $params['field']= isset($tag['field']) ? $tag['field'] : '*'; $params['limit']= isset($tag['limit']) ? $tag['limit'] : '10'; $params['order']= isset($tag['order']) ? $tag['order'] : ''; $params['sort']= isset($tag['sort']) ? $tag['sort'] : ''; $params['group']= isset($tag['group']) ? $tag['group'] : ''; $params['page_is']= isset($tag['page_is']) ? $tag['page_is'] : false; $params['page_id']= isset($tag['page_id']) ? $tag['page_id'] : ''; $params['page_p']= isset($tag['page_p']) ? $tag['page_p'] : ''; if($tag['cache_name'] == 'default'){ $params['cache_name'] = md5(C('cache_foreach_prefix').'_'.implode('_',$tag)); }else{ $params['cache_name']= isset($tag['cache_name']) ? md5(C('cache_foreach_prefix').'_'.$tag['cache_name']) : ''; } if($tag['cache_time'] == 'default'){ $params['cache_time']= intval(C('cache_foreach')); }else{ $params['cache_time']= isset($tag['cache_time']) ? intval($tag['cache_time']) : ''; } return $params; } function ff_mysql_nav($tag){ $tag = ff_param_lable($tag); $where = array(); $where['nav_status'] = array('eq',1); if ($tag['ids']) { $where['nav_id'] = array('in',$tag['ids']); } if (isset($tag['pid'])) { $where['nav_pid'] = array('in',$tag['pid']); } return D('Nav')->ff_select_page(ff_mysql_param($tag), $where); } function ff_mysql_slide($tag){ $tag = ff_param_lable($tag); $where = array(); $where['slide_status'] = array('eq',1); if ($tag['ids']) { $where['slide_id'] = array('in',$tag['ids']); } if ($tag['cid']) { $where['slide_cid'] = array('in',$tag['cid']); } return D('Slide')->ff_select_page(ff_mysql_param($tag), $where); } function ff_mysql_list($tag){ $tag = ff_param_lable($tag); $where = array(); $where['list_status'] = array('eq',1); if ($tag['ids']) { $where['list_id'] = array('in',$tag['ids']); } if (isset($tag['pid'])) { $where['list_pid'] = array('in',$tag['pid']); } if ($tag['sid']) { $where['list_sid'] = array('in',$tag['sid']); } return D('List')->ff_select_page(ff_mysql_param($tag), $where); } function ff_mysql_link($tag){ $tag = ff_param_lable($tag); $where = array(); if ($tag['ids']) { $where['link_id'] = array('in',$tag['ids']); } if ($tag['type']) { $where['link_type'] = array('eq',$tag['type']); } return D('Link')->ff_select_page(ff_mysql_param($tag), $where); } function ff_mysql_tags($tag_str){ $tag = ff_param_lable($tag_str); $where = array(); if ($tag['ids']) { $where['tag_id'] = array('in',$tag['ids']); } if ($tag['cid']) { $where['tag_cid'] = array('in',$tag['cid']); } if ($tag['list']) { $where['tag_list'] = array('eq',''.$tag['list'].''); } $rs = D('Tag'); return $rs->ff_select_page(ff_mysql_param($tag), $where); } function ff_mysql_vod($tag_str){ $tag = ff_param_lable($tag_str); $where = array(); $where['vod_status'] = array('eq',1); if ($tag['ids']) { $where['vod_id'] = array('in',$tag['ids']); } if ($tag['ids_not']) { $where['vod_id'] = array('not in',$tag['ids_not']); } if ($tag['cid']) { $where['vod_cid'] = array('in',$tag['cid']); } if ($tag['cid_not']) { $where['vod_cid'] = array('not in',$tag['cid_not']); } if ($tag['stars']) { $where['vod_stars'] = array('in',$tag['stars']); } if ($tag['letter']) { $where['vod_letter'] = array('in',$tag['letter']); } if ($tag['upday']) { $where['vod_addtime'] = array('gt',ff_linux_time($tag['upday'])); } if (isset($tag['lastday'])) { $where['vod_hits_lasttime'] = array('gt',ff_linux_time($tag['lastday'])); } if (isset($tag['filmday'])) { $where['vod_filmtime'] = array('gt',ff_linux_time($tag['filmday'])); } if (isset($tag['copyright'])) { $where['vod_copyright'] = array('gt',$tag['copyright']); } if($tag['continu']){ $where['vod_continu'] = array('neq',0); } if($tag['pic_slide']){ $where['vod_pic_slide'] = array('neq',''); } if($tag['pic_bg']){ $where['vod_pic_bg'] = array('neq',''); } if($tag['scenario']){ $where['vod_scenario'] = array('neq',''); } if ($tag['ispay'] != "") { $where['vod_ispay'] = array('eq', intval($tag['ispay'])); } if ($tag['list_ename']) { $where['list_dir'] = array('eq',$tag['list_ename']); } if($tag['isend'] == 'true'){ $where['vod_isend'] = array('eq', 1); }else if($tag['isend'] == 'false'){ $where['vod_isend'] = array('eq', 0); } if ($tag['year']) { $year = explode(',',$tag['year']); if (count($year) > 1) { $where['vod_year'] = array('between',$year[0].','.$year[1]); }else{ $where['vod_year'] = array('eq',$tag['year']); } } if ($tag['state']) { $where['vod_state'] = array('eq',$tag['state']); } if ($tag['version']) { $where['vod_version'] = array('eq',$tag['version']); } if ($tag['series']) { $where['vod_series'] = array('eq',$tag['series']); } if ($tag['tv']) { $where['vod_tv'] = array('eq',$tag['tv']); } if ($tag['inputer']) { $where['vod_inputer'] = array('eq',$tag['inputer']); } if ($tag['name']) { $where['vod_name'] = array('like','%'.$tag['name'].'%'); } if ($tag['title']) { $where['vod_title'] = array('like','%'.$tag['title'].'%'); } if ($tag['actor']) { $where['vod_actor'] = array('like','%'.$tag['actor'].'%'); } if ($tag['director']) { $where['vod_director'] = array('like','%'.$tag['director'].'%'); } if ($tag['weekday']) { foreach(explode(',',$tag['weekday']) as $key=>$value){ $where['vod_weekday'][] = array('like','%'.$value.'%'); } $where['vod_weekday'][] = 'or'; } if ($tag['area']) { foreach(explode(',',$tag['area']) as $key=>$value){ $where['vod_area'][] = array('like','%'.$value.'%'); } $where['vod_area'][] = 'or'; } if ($tag['language']) { foreach(explode(',',$tag['language']) as $key=>$value){ $where['vod_language'][] = array('like','%'.$value.'%'); } $where['vod_language'][] = 'or'; } if ($tag['play']) { $where['vod_play'] = array('like','%'.$tag['play'].'%'); } if ($tag['wd']) { $search = array(); $search['vod_name'] = array('like','%'.$tag['wd'].'%'); $search['vod_title'] = array('like','%'.$tag['wd'].'%'); $search['vod_actor'] = array('like','%'.$tag['wd'].'%'); $search['vod_director'] = array('like','%'.$tag['wd'].'%'); $search['_logic'] = 'or'; $where['_complex'] = $search; } if ($tag['hits']) { $hits = explode(',',$tag['hits']); if (count($hits) > 1) { $where['vod_hits'] = array('between',$hits[0].','.$hits[1]); }else{ $where['vod_hits'] = array('gt',$hits[0]); } } if ($tag['up']) { $up = explode(',',$tag['up']); if (count($up) > 1) { $where['vod_up'] = array('between',$up[0].','.$up[1]); }else{ $where['vod_up'] = array('gt',$up[0]); } } if ($tag['down']) { $down = explode(',',$tag['down']); if (count($down) > 1) { $where['vod_down'] = array('between',$down[0].','.$down[1]); }else{ $where['vod_down'] = array('gt',$down[0]); } } if ($tag['gold']) { $gold = explode(',',$tag['gold']); if (count($gold) > 1) { $where['vod_gold'] = array('between',$gold[0].','.$gold[1]); }else{ $where['vod_gold'] = array('gt',$gold[0]); } } if ($tag['golder']) { $golder = explode(',',$tag['golder']); if (count($golder) > 1) { $where['vod_golder'] = array('between',$golder[0].','.$golder[1]); }else{ $where['vod_golder'] = array('gt',$golder[0]); } } if($tag['tag_name']){ $where['tag_name'] = array('in',$tag['tag_name']); if($tag['tag_cid']){ $where['tag_cid'] = array('in',$tag['tag_cid']); } if($tag['tag_list']){ $where['tag_list'] = $tag['tag_list']; } if($tag['tag_ename']){ $where['tag_ename'] = $tag['tag_ename']; } $rs = D('TagvodView'); }else{ $rs = D('VodView'); } return $rs->ff_select_page(ff_mysql_param($tag), $where); } function ff_mysql_news($tag_str){ $tag = ff_param_lable($tag_str); $where = array(); $where['news_status'] = array('eq',1); if ($tag['ids']) { $where['news_id'] = array('in',$tag['ids']); } if ($tag['ids_not']) { $where['news_id'] = array('not in',$tag['ids_not']); } if ($tag['cid']) { $where['news_cid'] = array('in',$tag['cid']); } if ($tag['cid_not']) { $where['news_cid'] = array('not in',$tag['cid_not']); } if ($tag['list_ename']) { $where['list_dir'] = array('eq',$tag['list_ename']); } if ($tag['stars']) { $where['news_stars'] = array('in',$tag['stars']); } if ($tag['letter']) { $where['news_letter'] = array('in',$tag['letter']); } if ($tag['day']) { $where['news_addtime'] = array('gt',ff_linux_time($tag['day'])); } if (isset($tag['lastday'])) { $where['news_hits_lasttime'] = array('gt',ff_linux_time($tag['lastday'])); } if ($tag['hits']) { $hits = explode(',',$tag['hits']); if (count($hits) > 1) { $where['news_hits'] = array('between',$hits[0].','.$hits[1]); }else{ $where['news_hits'] = array('gt',$hits[0]); } } if ($tag['up']) { $up = explode(',',$tag['up']); if (count($up) > 1) { $where['news_up'] = array('between',$up[0].','.$up[1]); }else{ $where['news_up'] = array('gt',$up[0]); } } if ($tag['down']) { $down = explode(',',$tag['down']); if (count($down) > 1) { $where['news_down'] = array('between',$down[0].','.$down[1]); }else{ $where['news_down'] = array('gt',$down[0]); } } if ($tag['gold']) { $gold = explode(',',$tag['gold']); if (count($gold) > 1) { $where['news_gold'] = array('between',$gold[0].','.$gold[1]); }else{ $where['news_gold'] = array('gt',$gold[0]); } } if ($tag['golder']) { $golder = explode(',',$tag['golder']); if (count($golder) > 1) { $where['news_golder'] = array('between',$golder[0].','.$golder[1]); }else{ $where['news_golder'] = array('gt',$golder[0]); } } if ($tag['name']) { $where['news_name'] = array('like','%'.$tag['name'].'%'); } if ($tag['title']) { $where['news_title'] = array('like','%'.$tag['title'].'%'); } if ($tag['remark']) { $where['news_remark'] = array('like','%'.$tag['remark'].'%'); } if($tag['pic_slide']){ $where['news_pic_slide'] = array('neq',''); } if($tag['pic_bg']){ $where['news_pic_bg'] = array('neq',''); } if ($tag['wd']) { $search = array(); $search['news_name'] = array('like','%'.$tag['wd'].'%'); $search['news_remark'] = array('like','%'.$tag['wd'].'%'); $search['_logic'] = 'or'; $where['_complex'] = $search; } if($tag['tag_name']){ $where['tag_name'] = array('in',$tag['tag_name']); if($tag['tag_cid']){ $where['tag_cid'] = array('in',$tag['tag_cid']); } if($tag['tag_list']){ $where['tag_list'] = $tag['tag_list']; } if($tag['tag_ename']){ $where['tag_ename'] = $tag['tag_ename']; } $rs = D('TagnewsView'); }else{ $rs = D('NewsView'); } return $rs->ff_select_page(ff_mysql_param($tag), $where); } function ff_mysql_special($tag){ $tag = ff_param_lable($tag); $where = array(); $where['special_status'] = array('eq',1); if ($tag['ids']) { $where['special_id'] = array('in',$tag['ids']); } if ($tag['hits']) { $hits = explode(',',$tag['hits']); if (count($hits) > 1) { $where['special_hits'] = array('between',$hits[0].','.$hits[1]); }else{ $where['special_hits'] = array('gt',$hits[0]); } } if ($tag['name']) { $where['special_name'] = array('like','%'.$tag['name'].'%'); } if ($tag['ename']) { $where['special_ename'] = array('like','%'.$tag['ename'].'%'); } if($tag['tag_name']){ $where['tag_name'] = array('in',$tag['tag_name']); if($tag['tag_cid']){ $where['tag_cid'] = array('in',$tag['tag_cid']); } if($tag['tag_list']){ $where['tag_list'] = $tag['tag_list']; } if($tag['tag_ename']){ $where['tag_ename'] = $tag['tag_ename']; } $rs = D('TagspecialView'); }else{ $rs = D('Special'); } return $rs->ff_select_page(ff_mysql_param($tag), $where); } function ff_mysql_forum($tag_str){ $tag = ff_param_lable($tag_str); $where = array(); if (isset($tag['status'])) { $where['forum_status'] = array('eq', $tag['status']); } if ($tag['sid']) { $where['forum_sid'] = array('eq',$tag['sid']); } if ($tag['ids']) { $where['forum_id'] = array('in',$tag['ids']); } if ($tag['ids_not']) { $where['forum_id'] = array('not in',$tag['ids_not']); } if ($tag['cid']) { $where['forum_cid'] = array('in',$tag['cid']); } if ($tag['cid_not']) { $where['forum_cid'] = array('not in',$tag['cid_not']); } if (isset($tag['pid'])) { $where['forum_pid'] = array('in',$tag['pid']); } if (isset($tag['pid_not'])) { $where['forum_pid'] = array('not in',$tag['pid_not']); } if ($tag['uid']) { $where['forum_uid'] = array('in',$tag['uid']); } if ($tag['uid_not']) { $where['forum_uid'] = array('not in',$tag['uid_not']); } if ($tag['up']) { $up = explode(',',$tag['up']); if (count($up) > 1) { $where['forum_up'] = array('between',$up[0].','.$up[1]); }else{ $where['forum_up'] = array('gt',$up[0]); } } if ($tag['down']) { $down = explode(',',$tag['down']); if (count($down) > 1) { $where['forum_down'] = array('between',$down[0].','.$down[1]); }else{ $where['forum_down'] = array('gt',$down[0]); } } if ($tag['upday']) { $where['forum_addtime'] = array('gt',ff_linux_time($tag['upday'])); } if ($tag['wd']) { $search = array(); $search['forum_content'] = array('like','%'.$tag['wd'].'%'); $search['forum_ip'] = array('like','%'.$tag['wd'].'%'); $search['user_name'] = array('like','%'.$tag['wd'].'%'); $search['_logic'] = 'or'; $where['_complex'] = $search; } if($tag['sid'] == 1){ $viewFields = array ( 'Forum'=>array('*'), 'User'=>array('user_id','user_name','user_face','_on'=>'Forum.forum_uid = User.user_id'), 'Vod'=>array('vod_id','vod_cid','vod_name','vod_title','vod_ename','vod_type','vod_actor','vod_director','vod_year','vod_area','vod_language','vod_pic','vod_content','vod_continu','vod_isend','vod_total','vod_hits','vod_up','vod_down','vod_addtime','vod_play','_on'=>'Forum.forum_cid = Vod.vod_id'), ); }else if($tag['sid'] == 2){ $viewFields = array ( 'Forum'=>array('*'), 'User'=>array('user_id','user_name','user_face','_on'=>'Forum.forum_uid = User.user_id'), 'News'=>array('*','_on'=>'Forum.forum_cid = News.news_id'), ); }else if($tag['sid'] == 3){ $viewFields = array ( 'Forum'=>array('*'), 'User'=>array('user_id','user_name','user_face','_on'=>'Forum.forum_uid = User.user_id'), 'Special'=>array('*','_on'=>'Forum.forum_cid = Special.special_id'), ); }else{ $viewFields = ''; } return D('ForumView')->ff_select_page(ff_mysql_param($tag), $where, $viewFields); } function ff_mysql_user($tag_str){ $tag = ff_param_lable($tag_str); $where = array(); if (isset($tag['status'])) { $where['user_status'] = array('eq', $tag['status']); } if ($tag['ids']) { $where['user_id'] = array('in',$tag['ids']); } if ($tag['pid']) { $where['user_pid'] = array('in',$tag['pid']); } if ($tag['follow']) { $arr = explode(',',$tag['follow']); if (count($arr) > 1) { $where['user_follow'] = array('between',$arr[0].','.$arr[1]); }else{ $where['user_follow'] = array('gt',$arr[0]); } } if ($tag['up']) { $up = explode(',',$tag['up']); if (count($up) > 1) { $where['user_up'] = array('between',$up[0].','.$up[1]); }else{ $where['user_up'] = array('gt',$up[0]); } } if ($tag['down']) { $down = explode(',',$tag['down']); if (count($down) > 1) { $where['user_down'] = array('between',$down[0].','.$down[1]); }else{ $where['user_down'] = array('gt',$down[0]); } } if ($tag['hits']) { $arr = explode(',',$tag['hits']); if (count($arr) > 1) { $where['user_hits'] = array('between',$arr[0].','.$arr[1]); }else{ $where['user_hits'] = array('gt',$arr[0]); } } if ($tag['addtime']) { $where['user_addtime'] = array('gt',ff_linux_time($tag['addtime'])); } if ($tag['logtime']) { $where['user_logtime'] = array('gt',ff_linux_time($tag['logtime'])); } if ($tag['wd']) { $search = array(); $search['user_name'] = array('like','%'.$tag['wd'].'%'); $search['user_email'] = array('like','%'.$tag['wd'].'%'); $search['_logic'] = 'or'; $where['_complex'] = $search; } return D('User')->ff_select_page(ff_mysql_param($tag), $where); } function ff_mysql_orders($tag_str){ $tag = ff_param_lable($tag_str); $where = array(); if (isset($tag['status'])) { $where['order_status'] = array('eq', $tag['status']); } if (isset($tag['ispay'])) { $where['order_ispay'] = array('eq', $tag['ispay']); } if (isset($tag['shipping'])) { $where['order_shipping'] = array('eq', $tag['shipping']); } if ($tag['ids']) { $where['order_id'] = array('in',$tag['ids']); } if ($tag['uid']) { $where['order_uid'] = array('in',$tag['uid']); } if ($tag['gid']) { $where['order_gid'] = array('in',$tag['gid']); } if ($tag['money']) { $arr = explode(',',$tag['money']); if (count($arr) > 1) { $where['order_money'] = array('between',$arr[0].','.$arr[1]); }else{ $where['order_money'] = array('gt',$arr[0]); } } if ($tag['addtime']) { $where['order_addtime'] = array('gt',ff_linux_time($tag['addtime'])); } if ($tag['paytime']) { $where['order_paytime'] = array('gt',ff_linux_time($tag['paytime'])); } if ($tag['confirmtime']) { $where['order_confirmtime'] = array('gt',ff_linux_time($tag['confirmtime'])); } if ($tag['wd']) { $search = array(); $search['order_sign'] = array('like','%'.$tag['wd'].'%'); $search['order_info'] = array('like','%'.$tag['wd'].'%'); $search['_logic'] = 'or'; $where['_complex'] = $search; } return D('OrdersView')->ff_select_page(ff_mysql_param($tag), $where); } function ff_mysql_record($tag_str){ $tag = ff_param_lable($tag_str); $where = array(); if ($tag['ids']) { $where['record_id'] = array('in',$tag['ids']); } if ($tag['sid']) { $where['record_sid'] = array('in',$tag['sid']); } if ($tag['did']) { $where['record_did'] = array('in',$tag['did']); } if ($tag['uid']) { $where['record_uid'] = array('in',$tag['uid']); } if ($tag['type']) { $where['record_type'] = array('in',$tag['type']); } if ($tag['upday']) { $where['record_time'] = array('gt',ff_linux_time($tag['upday'])); } if($tag['sid'] == 1){ $viewFields = array ( 'Record'=>array('*'), 'User'=>array('user_id','user_name','user_email','user_face','_on'=>'Record.record_uid = User.user_id'), 'Vod'=>array('*','_on'=>'Record.record_did = Vod.vod_id'), ); }else if($tag['sid'] == 2){ $viewFields = array ( 'Record'=>array('*'), 'User'=>array('user_id','user_name','user_email','user_face','_on'=>'Record.record_uid = User.user_id'), 'News'=>array('*','_on'=>'Record.record_did = News.news_id'), ); }else if($tag['sid'] == 3){ array ( 'Record'=>array('*'), 'User'=>array('user_id','user_name','user_email','user_face','_on'=>'Record.record_uid = User.user_id'), 'Special'=>array('*','_on'=>'Record.record_did = Special.special_id'), ); }else{ $viewFields = ''; } return D('RecordView')->ff_select_page(ff_mysql_param($tag), $where, $viewFields); } function ff_mysql_score($tag_str){ $tag = ff_param_lable($tag_str); $where = array(); if ($tag['ids']) { $where['score_id'] = array('in',$tag['ids']); } if ($tag['sid']) { $where['score_sid'] = array('in',$tag['sid']); } if ($tag['did']) { $where['score_did'] = array('in',$tag['did']); } if ($tag['uid']) { $where['score_uid'] = array('in',$tag['uid']); } if ($tag['type']) { $where['score_type'] = array('in',$tag['type']); } if ($tag['addtime']) { $where['score_addtime'] = array('gt',ff_linux_time($tag['addtime'])); } if($tag['sid'] == 1){ $viewFields = array ( 'Score'=>array('*'), 'User'=>array('user_id','user_name','user_face','_on'=>'Score.score_uid = User.user_id'), 'Vod'=>array('vod_name'=>'detail_name','vod_cid'=>'detail_cid','_on'=>'Record.record_did = Vod.vod_id'), ); }else if($tag['sid'] == 2){ $viewFields = array ( 'Score'=>array('*'), 'User'=>array('user_id','user_name','user_face','_on'=>'Score.score_uid = User.user_id'), 'News'=>array('new_name'=>'detail_name','news_cid'=>'detail_cid','_on'=>'Record.record_did = News.news_id'), ); }else if($tag['sid'] == 3){ array ( 'Score'=>array('*'), 'User'=>array('user_id','user_name','user_face','_on'=>'Score.score_uid = User.user_id'), 'Special'=>array('special_name'=>'detail_name','_on'=>'Record.record_did = Special.special_id'), ); }else{ $viewFields = ''; } return D('ScoreView')->ff_select_page(ff_mysql_param($tag), $where, $viewFields); } function ff_mysql_card($tag_str){ $tag = ff_param_lable($tag_str); $where = array(); if (isset($tag['status'])) { $where['card_status'] = array('eq', $tag['status']); } if ($tag['ids']) { $where['card_id'] = array('in',$tag['ids']); } if ($tag['uid']) { $where['card_did'] = array('in',$tag['uid']); } if ($tag['face']) { $where['card_face'] = array('eq',$tag['face']); } if ($tag['wd']) { $where['card_number'] = array('like','%'.$tag['wd'].'%'); } return D('CardView')->ff_select_page(ff_mysql_param($tag), $where, false); } function get_client_ip(){ if (getenv("HTTP_CLIENT_IP") && strcasecmp(getenv("HTTP_CLIENT_IP"), "unknown")) $ip = getenv("HTTP_CLIENT_IP"); else if (getenv("HTTP_X_FORWARDED_FOR") && strcasecmp(getenv("HTTP_X_FORWARDED_FOR"), "unknown")) $ip = getenv("HTTP_X_FORWARDED_FOR"); else if (getenv("REMOTE_ADDR") && strcasecmp(getenv("REMOTE_ADDR"), "unknown")) $ip = getenv("REMOTE_ADDR"); else if (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], "unknown")) $ip = $_SERVER['REMOTE_ADDR']; else $ip = "unknown"; return($ip); } function h($text, $tags = null){ $text = trim($text); $text = preg_replace('/<!--?.*-->/','',$text); $text = preg_replace('/<\?|\?'.'>/','',$text); $text = preg_replace('/<script?.*\/script>/','',$text); $text = str_replace('[','&#091;',$text); $text = str_replace(']','&#093;',$text); $text = str_replace('|','&#124;',$text); $text = preg_replace('/\r?\n/','',$text); $text = preg_replace('/<br(\s\/)?'.'>/i','[br]',$text); $text = preg_replace('/(\[br\]\s*){10,}/i','[br]',$text); while(preg_match('/(<[^><]+)( lang|on|action|background|codebase|dynsrc|lowsrc)[^><]+/i',$text,$mat)){ $text=str_replace($mat[0],$mat[1],$text); } while(preg_match('/(<[^><]+)(window\.|javascript:|js:|about:|file:|document\.|vbs:|cookie)([^><]*)/i',$text,$mat)){ $text=str_replace($mat[0],$mat[1].$mat[3],$text); } if(empty($tags)) { $tags = 'table|td|th|tr|i|b|u|strong|img|p|br|div|strong|em|ul|ol|li|dl|dd|dt|a'; } $text = preg_replace('/<('.$tags.')( [^><\[\]]*)>/i','[\1\2]',$text); $text = preg_replace('/<\/?(html|head|meta|link|base|basefont|body|bgsound|title|style|script|form|iframe|frame|frameset|applet|id|ilayer|layer|name|script|style|xml)[^><]*>/i','',$text); while(preg_match('/<([a-z]+)[^><\[\]]*>[^><]*<\/\1>/i',$text,$mat)){ $text=str_replace($mat[0],str_replace('>',']',str_replace('<','[',$mat[0])),$text); } while(preg_match('/(\[[^\[\]]*=\s*)(\"|\')([^\2=\[\]]+)\2([^\[\]]*\])/i',$text,$mat)){ $text=str_replace($mat[0],$mat[1].'|'.$mat[3].'|'.$mat[4],$text); } while(preg_match('/\[[^\[\]]*(\"|\')[^\[\]]*\]/i',$text,$mat)){ $text=str_replace($mat[0],str_replace($mat[1],'',$mat[0]),$text); } $text = str_replace('<','&lt;',$text); $text = str_replace('>','&gt;',$text); $text = str_replace('"','&quot;',$text); $text = str_replace('[','<',$text); $text = str_replace(']','>',$text); $text = str_replace('|','"',$text); $text = str_replace('  ',' ',$text); return $text; } function remove_xss($val) { $val = preg_replace('/([\x00-\x08,\x0b-\x0c,\x0e-\x19])/', '', $val); $search = 'abcdefghijklmnopqrstuvwxyz'; $search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; $search .= '1234567890!@#$%^&*()'; $search .= '~`";:?+/={}[]-_|\'\\'; for ($i = 0; $i < strlen($search); $i++) { $val = preg_replace('/(&#[xX]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); $val = preg_replace('/(&#0{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); } $ra1 = array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base'); $ra2 = array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload'); $ra = array_merge($ra1, $ra2); $found = true; while ($found == true) { $val_before = $val; for ($i = 0; $i < sizeof($ra); $i++) { $pattern = '/'; for ($j = 0; $j < strlen($ra[$i]); $j++) { if ($j > 0) { $pattern .= '('; $pattern .= '(&#[xX]0{0,8}([9ab]);)'; $pattern .= '|'; $pattern .= '|(&#0{0,8}([9|10|13]);)'; $pattern .= ')*'; } $pattern .= $ra[$i][$j]; } $pattern .= '/i'; $replacement = substr($ra[$i], 0, 2).'<x>'.substr($ra[$i], 2); $val = preg_replace($pattern, $replacement, $val); if ($val_before == $val) { $found = false; } } } return $val; } function list_to_tree($list, $pk='id',$pid = 'pid',$child = '_child',$root=0) { $tree = array(); if(is_array($list)) { $refer = array(); foreach ($list as $key => $data) { $refer[$data[$pk]] =& $list[$key]; } foreach ($list as $key => $data) { $parentId = $data[$pid]; if ($root == $parentId) { $tree[] =& $list[$key]; }else{ if (isset($refer[$parentId])) { $parent =& $refer[$parentId]; $parent[$child][] =& $list[$key]; } } } } return $tree; } function list_search($list,$condition) { if(is_string($condition)) parse_str($condition,$condition); $resultSet = array(); foreach ($list as $key=>$data){ $find = false; foreach ($condition as $field=>$value){ if(isset($data[$field])) { if(0 === strpos($value,'/')) { $find = preg_match($value,$data[$field]); }elseif($data[$field]==$value){ $find = true; } } } if($find) $resultSet[] = &$list[$key]; } return $resultSet; } function byte_format($size, $dec=2) { $a = array("B", "KB", "MB", "GB", "TB", "PB"); $pos = 0; while ($size >= 1024) { $size /= 1024; $pos++; } return round($size,$dec)." ".$a[$pos]; } function list_sort_by($list,$field, $sortby='asc') { if(is_array($list)){ $refer = $resultSet = array(); foreach ($list as $i => $data) $refer[$i] = &$data[$field]; switch ($sortby) { case 'asc': asort($refer); break; case 'desc': arsort($refer); break; case 'nat': natcasesort($refer); break; } foreach ( $refer as $key=> $val) $resultSet[] = &$list[$key]; return $resultSet; } return false; } return array ( 'app_debug' => false, 'app_domain_deploy' => false, 'app_sub_domain_deploy' => 0, 'app_plugin_on' => false, 'app_file_case' => false, 'app_group_depr' => '.', 'app_group_list' => 'Admin,Home,Plus', 'app_autoload_reg' => false, 'app_autoload_path' => 'Think.Util.', 'app_config_list' => array ( 0 => 'taglibs', 1 => 'routes', 2 => 'tags', 3 => 'htmls', 4 => 'modules', 5 => 'actions', ), 'cookie_expire' => 3600, 'cookie_domain' => '', 'cookie_path' => '/', 'cookie_prefix' => '', 'default_app' => '@', 'default_group' => 'Home', 'default_module' => 'Index', 'default_action' => 'index', 'default_charset' => 'utf-8', 'default_timezone' => 'PRC', 'default_ajax_return' => 'JSON', 'default_theme' => 'default', 'default_lang' => 'zh-cn', 'db_type' => 'mysql', 'db_host' => 'localhost', 'db_name' => 'mvcms', 'db_user' => 'root', 'db_pwd' => '', 'db_port' => '3306', 'db_prefix' => 'yy_', 'db_suffix' => '', 'db_fieldtype_check' => true, 'db_fields_cache' => true, 'db_charset' => 'utf8', 'db_deploy_type' => 0, 'db_rw_separate' => false, 'data_cache_time' => -1, 'data_cache_compress' => false, 'data_cache_check' => false, 'data_cache_type' => 'file', 'data_cache_path' => './Runtime/Temp/', 'data_cache_subdir' => true, 'data_path_level' => 2, 'error_message' => '您浏览的页面暂时发生了错误！请稍后再试～', 'error_page' => '', 'html_cache_on' => false, 'html_cache_time' => 0, 'html_read_type' => 0, 'html_file_suffix' => '.html', 'lang_switch_on' => true, 'lang_auto_detect' => false, 'log_exception_record' => true, 'log_record' => false, 'log_file_size' => 2097152, 'log_record_level' => array ( 0 => 'EMERG', 1 => 'ALERT', 2 => 'CRIT', 3 => 'ERR', ), 'page_rollpage' => 5, 'page_listrows' => 20, 'session_auto_start' => true, 'show_run_time' => false, 'show_adv_time' => false, 'show_db_times' => false, 'show_cache_times' => false, 'show_use_mem' => false, 'show_page_trace' => false, 'show_error_msg' => true, 'tmpl_engine_type' => 'Think', 'tmpl_detect_theme' => true, 'tmpl_template_suffix' => '.html', 'tmpl_content_type' => 'text/html', 'tmpl_cachfile_suffix' => '.php', 'tmpl_deny_func_list' => 'echo,exit', 'tmpl_parse_string' => '', 'tmpl_l_delim' => '{', 'tmpl_r_delim' => '}', 'tmpl_var_identify' => 'array', 'tmpl_strip_space' => false, 'tmpl_cache_on' => false, 'tmpl_cache_time' => -1, 'tmpl_action_error' => './Public/jump/jumpurl.html', 'tmpl_action_success' => './Public/jump/jumpurl.html', 'tmpl_trace_file' => './Lib/ThinkPHP/Tpl/PageTrace.tpl.php', 'tmpl_exception_file' => './Lib/ThinkPHP/Tpl/ThinkException.tpl.php', 'tmpl_file_depr' => '_', 'taglib_begin' => '<', 'taglib_end' => '>', 'taglib_load' => true, 'taglib_build_in' => 'cx', 'taglib_pre_load' => '', 'tag_nested_level' => 3, 'tag_extend_parse' => '', 'token_on' => true, 'token_name' => '__hash__', 'token_type' => 'md5', 'url_case_insensitive' => true, 'url_router_on' => '0', 'url_route_rules' => array ( 0 => array ( 0 => '/movie$/', 1 => 'vod/show', 2 => 'cms', 3 => 'id=1', ), 1 => array ( 0 => '/drama$/', 1 => 'vod/show', 2 => 'cms', 3 => 'id=2', ), 2 => array ( 0 => '/comic$/', 1 => 'vod/show', 2 => 'cms', 3 => 'id=3', ), 3 => array ( 0 => '/show$/', 1 => 'vod/show', 2 => 'cms', 3 => 'id=4', ), 4 => array ( 0 => '/ugc$/', 1 => 'vod/show', 2 => 'cms', 3 => 'id=5', ), 5 => array ( 0 => '/video\\/channel\\/([0-9]+)-([0-9]+)$/', 1 => 'vod/show', 2 => 'id,p', 3 => NULL, ), 6 => array ( 0 => '/video\\/channel\\/([0-9]+)$/', 1 => 'vod/show', 2 => 'id', 3 => NULL, ), 7 => array ( 0 => '/video\\/detail\\/([0-9]+)$/', 1 => 'vod/read', 2 => 'id', 3 => NULL, ), 8 => array ( 0 => '/video\\/play\\/([0-9]+)-([0-9]+)-([0-9]+)$/', 1 => 'vod/play', 2 => 'id,sid,pid', 3 => NULL, ), 9 => array ( 0 => '/video\\/name\\/(.*)\\/([0-9]+)$/', 1 => 'vod/search', 2 => 'name,p', 3 => NULL, ), 10 => array ( 0 => '/video\\/name\\/(.*)$/', 1 => 'vod/search', 2 => 'name', 3 => NULL, ), 11 => array ( 0 => '/video\\/actor\\/(.*)$/', 1 => 'vod/search', 2 => 'actor', 3 => NULL, ), 12 => array ( 0 => '/video\\/director\\/(.*)$/', 1 => 'vod/search', 2 => 'director', 3 => NULL, ), 13 => array ( 0 => '/video\\/search\\/(.*)$/', 1 => 'vod/search', 2 => 'wd', 3 => NULL, ), 14 => array ( 0 => '/video\\/tags\\/(.*)\\/([0-9]+)$/', 1 => 'vod/tags', 2 => 'name,p', 3 => NULL, ), 15 => array ( 0 => '/video\\/tags\\/(.*)$/', 1 => 'vod/tags', 2 => 'name', 3 => NULL, ), 16 => array ( 0 => '/video\\/rss\\/([0-9]+)$/', 1 => 'vod/rss', 2 => 'id', 3 => NULL, ), 17 => array ( 0 => '/video\\/type([0-9]+)\\/(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-([0-9]+)$/', 1 => 'vod/type', 2 => 'id,type,area,year,star,state,order,p', 3 => NULL, ), 18 => array ( 0 => '/video\\/type([0-9]+)\\/(.*)-(.*)-(.*)-(.*)-(.*)-(.*)$/', 1 => 'vod/type', 2 => 'id,type,area,year,star,state,order', 3 => NULL, ), 19 => array ( 0 => '/scenario\\/([0-9]+)-([0-9]+)$/', 1 => 'vod/scenario', 2 => 'id,pid', 3 => NULL, ), 20 => array ( 0 => '/scenario\\/([0-9]+)$/', 1 => 'vod/scenario', 2 => 'id', 3 => NULL, ), 21 => array ( 0 => '/news\\/detail\\/([0-9]+)-([0-9]+)$/', 1 => 'news/read', 2 => 'id,p', 3 => NULL, ), 22 => array ( 0 => '/news\\/detail\\/([0-9]+)$/', 1 => 'news/read', 2 => 'id', 3 => NULL, ), 23 => array ( 0 => '/news\\/channel\\/([0-9]+)-([0-9]+)$/', 1 => 'news/show', 2 => 'id,p', 3 => NULL, ), 24 => array ( 0 => '/news\\/channel\\/([0-9]+)$/', 1 => 'news/show', 2 => 'id', 3 => NULL, ), 25 => array ( 0 => '/news\\/search\\/(.*)$/', 1 => 'news/search', 2 => 'wd', 3 => NULL, ), 26 => array ( 0 => '/news\\/tags\\/(.*)\\/([0-9]+)$/', 1 => 'news/tags', 2 => 'name,p', 3 => NULL, ), 27 => array ( 0 => '/news\\/tags\\/(.*)$/', 1 => 'news/tags', 2 => 'name', 3 => NULL, ), 28 => array ( 0 => '/news\\/type\\/(.*)-([0-9]+)-([0-9]+)$/', 1 => 'news/type', 2 => 'type,id,p', 3 => NULL, ), 29 => array ( 0 => '/news\\/type\\/(.*)-([0-9]+)$/', 1 => 'news/type', 2 => 'type,id', 3 => NULL, ), 30 => array ( 0 => '/topic\\/([0-9]+)$/', 1 => 'special/show', 2 => 'p', 3 => NULL, ), 31 => array ( 0 => '/topic\\/detail\\/([0-9]+)$/', 1 => 'special/read', 2 => 'id', 3 => NULL, ), ), 'url_model' => 3, 'url_pathinfo_model' => 2, 'url_pathinfo_depr' => '-', 'url_html_suffix' => '.html', 'var_group' => 'g', 'var_module' => 'm', 'var_action' => 'a', 'var_router' => 'r', 'var_page' => 'p', 'var_template' => 'theme', 'var_language' => 'l', 'var_ajax_submit' => 'ajax', 'var_pathinfo' => 's', 'default_theme_m' => 'default_m', 'site_name' => '飞飞影视导航系统', 'site_path' => '/yy9278/', 'site_domain' => 'www.feifeicms.com', 'site_domain_m' => '', 'site_title' => '飞飞影视导航系统首页', 'site_keywords' => '飞飞影视导航系统,PHP电影程序,电影网站程序', 'site_description' => '努力打造飞飞影视导航系统为最好的PHP影视系统!', 'site_email' => '110119@qq.com', 'site_copyright' => '本网站为非赢利性站点，本网站所有内容均来源于互联网相关站点自动搜索采集信息，相关链接已经注明来源。', 'site_hot' => '影片1
影片2
影片3
影片4
影片5
影片6||_blank
feifeicms|http://www.feifeicms.com|_blank', 'site_tongji' => '<script language="javascript" type="text/javascript" src="http://js.users.51.la/14834816.js"></script>', 'site_icp' => 'ICP备2010111号', 'admin_ads_file' => 'Runtime/Js', 'admin_order_type' => 'addtime', 'cache_foreach' => '0', 'cache_page_list' => '0', 'cache_page_type' => '0', 'cache_page_vod' => '0', 'cache_page_news' => '0', 'cache_page_special' => '0', 'cache_page_user' => '0', 'cache_page_cm' => '0', 'cache_page_forum' => '0', 'cache_page_images' => '0', 'cache_foreach_prefix' => '599d8d6968295', 'upload_path' => 'Uploads', 'upload_style' => 'Y-m-d', 'upload_class' => 'jpg,gif,png,jpeg', 'upload_thumb' => 0, 'upload_thumb_w' => '120', 'upload_thumb_h' => '140', 'upload_water' => false, 'upload_water_img' => './Public/images/water.gif', 'upload_water_pct' => '75', 'upload_water_pos' => '9', 'upload_face_width' => '0', 'upload_face_height' => '0', 'upload_http' => false, 'upload_http_down' => '5', 'upload_http_prefix' => '', 'upload_ftp' => false, 'upload_ftp_host' => '', 'upload_ftp_user' => '', 'upload_ftp_pass' => '', 'upload_ftp_port' => '', 'upload_ftp_dir' => '', 'upload_ftp_del' => '0', 'upload_safety' => '', 'play_width' => '640', 'play_height' => '420', 'play_playad' => 'http://cdn.feifeicms.co/loading/3.0/', 'play_second' => 10, 'play_language' => '国语,英语,粤语,闽南语,韩语,日语,国语/粤语,其它', 'play_area' => '大陆,香港,台湾,美国,韩国,日本,泰国,新加坡,马来西亚,印度,英国,法国,加拿大,西班牙,俄罗斯,其它', 'play_year' => '2018,2017,2016,2015,2014,2013,2012,2011,2010,2009,2008,2007,2006,2005,2004,2003,2002,2001,2000,1990,1980,1970,1960,1950', 'play_server' => array ( 'down_a' => 'http://downa.feifeicms.com/', 'down_b' => 'http://downb.feifeicms.com/', ), 'play_cloud' => 'http://cdn.feifeicms.co/player/3.0/', 'play_type' => '爱情,动作,喜剧,战争,科幻,剧情,武侠,冒险,枪战,恐怖,微电影,其它', 'play_state' => '正片,预告片,花絮', 'play_version' => '高清版,剧场版,抢先版,OVA,TV,影院版', 'play_jiexi' => '', 'play_weekday' => '一,二,三,四,五,六,日', 'collect_original' => false, 'collect_time' => '1', 'collect_name' => '0', 'collect_ips' => '', 'collect_hits' => '99', 'collect_updown' => '99', 'collect_gold' => '9', 'collect_golder' => '99', 'collect_tags' => '0', 'collect_passwd' => '', 'collect_forum' => '3000', 'news_type' => '段子手,私房话,八卦精,爱生活,汽车迷,科技咖,美食家,辣妈帮', 'user_second' => '3600', 'user_replace' => '她妈|它妈|他妈|你妈|去死|贱人', 'user_check' => '0', 'url_rewrite' => '0', 'url_html' => '0', 'url_vod_list' => 'video/{listdir}/{id}-{page}', 'url_vod_detail' => 'video/{listdir}/{id}/', 'url_vod_play' => 'video/{listdir}/{id}/{sid}-{pid}', 'url_news_list' => 'news/{listdir}/{id}-{page}', 'url_news_detail' => 'news/{listdir}/{id}/{page}', 'url_time' => '1', 'url_number' => '10', 'html_home_suffix' => '.html', 'html_cache_index' => '1', 'html_cache_list' => '1.5', 'html_cache_content' => '12', 'html_cache_play' => '12', 'html_cache_iframe' => '12', 'html_cache_type' => '0.5', 'html_cache_ajax' => '12', '_htmls_' => array ( 'home:index:index' => NULL, 'home:vod:type' => NULL, 'home:news:type' => NULL, 'home:vod:show' => NULL, 'home:news:show' => NULL, 'home:vod:read' => NULL, 'home:news:read' => NULL, 'home:vod:play' => NULL, 'home:my:show' => NULL, ), 'rewrite_route' => 'vod-show-cms-movie===movie===id=1
vod-show-cms-drama===drama===id=2
vod-show-cms-comic===comic===id=3
vod-show-cms-show===show===id=4
vod-show-cms-ugc===ugc===id=5
vod-show-id-(:num)-p-(:num)===video/channel/(:num)-(:num)
vod-show-id-(:num)===video/channel/(:num)
vod-read-id-(:num)===video/detail/(:num)
vod-play-id-(:num)-sid-(:num)-pid-(:num)===video/play/(:num)-(:num)-(:num)
vod-search-name-(:any)-p-(:num)===video/name/(:any)/(:num)
vod-search-name-(:any)===video/name/(:any)
vod-search-actor-(:any)===video/actor/(:any)
vod-search-director-(:any)===video/director/(:any)
vod-search-wd-(:any)===video/search/(:any)
vod-tags-name-(:any)-p-(:num)===video/tags/(:any)/(:num)
vod-tags-name-(:any)===video/tags/(:any)
vod-rss-id-(:num)===video/rss/(:num)
vod-type-id-(:num)-type-(:any)-area-(:any)-year-(:any)-star-(:any)-state-(:any)-order-(:any)-p-(:num)===video/type(:num)/(:any)-(:any)-(:any)-(:any)-(:any)-(:any)-(:num)
vod-type-id-(:num)-type-(:any)-area-(:any)-year-(:any)-star-(:any)-state-(:any)-order-(:any)===video/type(:num)/(:any)-(:any)-(:any)-(:any)-(:any)-(:any)
vod-scenario-id-(:num)-pid-(:num)===scenario/(:num)-(:num)
vod-scenario-id-(:num)===scenario/(:num)
news-read-id-(:num)-p-(:num)===news/detail/(:num)-(:num)
news-read-id-(:num)===news/detail/(:num)
news-show-id-(:num)-p-(:num)===news/channel/(:num)-(:num)
news-show-id-(:num)===news/channel/(:num)
news-search-wd-(:any)===news/search/(:any)
news-tags-name-(:any)-p-(:num)===news/tags/(:any)/(:num)
news-tags-name-(:any)===news/tags/(:any)
news-type-type-(:any)-id-(:num)-p-(:num)===news/type/(:any)-(:num)-(:num)
news-type-type-(:any)-id-(:num)===news/type/(:any)-(:num)
special-show-p-(:num)===topic/(:num)
special-read-id-(:num)===topic/detail/(:num)', 'url_rewrite_rules' => array ( 'vod/show/cms' => array ( 'find' => 'vod-show-cms-ugc', 'replace' => 'ugc', ), 'vod/show/id/p' => array ( 'find' => 'vod-show-id-([0-9]+)-p-([0-9]+)', 'replace' => 'video/channel/$1-$2', ), 'vod/show/id' => array ( 'find' => 'vod-show-id-([0-9]+)', 'replace' => 'video/channel/$1', ), 'vod/read/id' => array ( 'find' => 'vod-read-id-([0-9]+)', 'replace' => 'video/detail/$1', ), 'vod/play/id/sid/pid' => array ( 'find' => 'vod-play-id-([0-9]+)-sid-([0-9]+)-pid-([0-9]+)', 'replace' => 'video/play/$1-$2-$3', ), 'vod/search/name/p' => array ( 'find' => 'vod-search-name-(.*)-p-([0-9]+)', 'replace' => 'video/name/$1/$2', ), 'vod/search/name' => array ( 'find' => 'vod-search-name-(.*)', 'replace' => 'video/name/$1', ), 'vod/search/actor' => array ( 'find' => 'vod-search-actor-(.*)', 'replace' => 'video/actor/$1', ), 'vod/search/director' => array ( 'find' => 'vod-search-director-(.*)', 'replace' => 'video/director/$1', ), 'vod/search/wd' => array ( 'find' => 'vod-search-wd-(.*)', 'replace' => 'video/search/$1', ), 'vod/tags/name/p' => array ( 'find' => 'vod-tags-name-(.*)-p-([0-9]+)', 'replace' => 'video/tags/$1/$2', ), 'vod/tags/name' => array ( 'find' => 'vod-tags-name-(.*)', 'replace' => 'video/tags/$1', ), 'vod/rss/id' => array ( 'find' => 'vod-rss-id-([0-9]+)', 'replace' => 'video/rss/$1', ), 'vod/type/id/type/area/year/star/state/order/p' => array ( 'find' => 'vod-type-id-([0-9]+)-type-(.*)-area-(.*)-year-(.*)-star-(.*)-state-(.*)-order-(.*)-p-([0-9]+)', 'replace' => 'video/type$1/$2-$3-$4-$5-$6-$7-$8', ), 'vod/type/id/type/area/year/star/state/order' => array ( 'find' => 'vod-type-id-([0-9]+)-type-(.*)-area-(.*)-year-(.*)-star-(.*)-state-(.*)-order-(.*)', 'replace' => 'video/type$1/$2-$3-$4-$5-$6-$7', ), 'vod/scenario/id/pid' => array ( 'find' => 'vod-scenario-id-([0-9]+)-pid-([0-9]+)', 'replace' => 'scenario/$1-$2', ), 'vod/scenario/id' => array ( 'find' => 'vod-scenario-id-([0-9]+)', 'replace' => 'scenario/$1', ), 'news/read/id/p' => array ( 'find' => 'news-read-id-([0-9]+)-p-([0-9]+)', 'replace' => 'news/detail/$1-$2', ), 'news/read/id' => array ( 'find' => 'news-read-id-([0-9]+)', 'replace' => 'news/detail/$1', ), 'news/show/id/p' => array ( 'find' => 'news-show-id-([0-9]+)-p-([0-9]+)', 'replace' => 'news/channel/$1-$2', ), 'news/show/id' => array ( 'find' => 'news-show-id-([0-9]+)', 'replace' => 'news/channel/$1', ), 'news/search/wd' => array ( 'find' => 'news-search-wd-(.*)', 'replace' => 'news/search/$1', ), 'news/tags/name/p' => array ( 'find' => 'news-tags-name-(.*)-p-([0-9]+)', 'replace' => 'news/tags/$1/$2', ), 'news/tags/name' => array ( 'find' => 'news-tags-name-(.*)', 'replace' => 'news/tags/$1', ), 'news/type/type/id/p' => array ( 'find' => 'news-type-type-(.*)-id-([0-9]+)-p-([0-9]+)', 'replace' => 'news/type/$1-$2-$3', ), 'news/type/type/id' => array ( 'find' => 'news-type-type-(.*)-id-([0-9]+)', 'replace' => 'news/type/$1-$2', ), 'special/show/p' => array ( 'find' => 'special-show-p-([0-9]+)', 'replace' => 'topic/$1', ), 'special/read/id' => array ( 'find' => 'special-read-id-([0-9]+)', 'replace' => 'topic/detail/$1', ), ), 'seo_cm_title' => '精彩影评', 'seo_cm_keywords' => '影评,剧评,观后感,评论', 'seo_cm_description' => '提供很多精彩的影视评论，欢迎阅读。', 'forum_type' => 'feifei', 'forum_type_uyan_uid' => '1528513', 'forum_type_changyan_appid' => 'cysXPib5E', 'forum_type_changyan_conf' => 'prod_68505537e56f813cfafdcf88027d242e', 'forum_seo_title' => '', 'forum_seo_keywords' => '', 'forum_seo_description' => '', 'app_sub_domain_rules' => '', 'user_register' => '1', 'user_register_check' => '0', 'user_register_score' => '10', 'user_register_second' => '3600', 'user_forum' => '1', 'user_pay_scale' => '10', 'user_pay_small' => '5', 'user_pay_vip_ext' => '10', 'user_pay_vip_small' => '5', 'user_pay_appid' => '', 'user_pay_appkey' => '', 'user_register_score_pid' => '10', 'user_register_vipday' => '0', 'user_register_welcome' => '', 'ui_scenario' => '10', 'ui_record' => '10', 'ui_playurl' => '34', 'ui_slide_index' => '3000', 'ui_search_limit' => 10, 'ui_slide_max' => '8', 'email_host' => '', 'email_username' => '', 'email_password' => '', 'email_usertest' => '', 'email_port' => '', 'email_secure' => '', 'pay_alipay_account' => '', 'pay_alipay_appid' => '', 'pay_alipay_appkey' => '', 'pay_wxpay_account' => '', 'pay_wxpay_appid' => '', 'pay_wxpay_appkey' => '', 'pay_paypal_account' => '', 'wx_check' => '0', 'wx_cids' => '', 'wx_limit' => '', 'wx_order' => '', 'wx_token' => '', 'wx_follow' => '', 'wx_none_txt' => '', 'wx_none_url' => '', 'wx_domain' => '', 'wx_jiexi' => '', 'wx_item' => array ( 'keyword' => array ( ), 'title' => array ( ), 'content' => array ( ), 'pic' => array ( ), 'link' => array ( ), ), 'user_auth_key' => 'feifeicms', 'not_auth_action' => 'index,show,add,top,left,main', 'require_auth_module' => 'Admin,List,Vod,News,User,Collect,Data,Upload,Link,Ads,Cache,Create,Tpl,Cm,Gb,Tag,Special,Nav,Side,Pic', 'admin_time_limit' => '300', 'home_pagenum' => '3', 'home_pagego' => 'pagego', ); ?>